import React, {useState} from 'react'
import {Button} from "antd";
import {CloseOutlined, CompressOutlined, ExpandOutlined, MinusOutlined} from "@ant-design/icons";
import './index.scss'

export default function () {
  const [isMax, setIsMax] = useState(false)

  return <div className={'title'}>
    <span>react-winform</span>
    <div className={'btnTitile'}>
      <Button type="text" icon={<MinusOutlined/>} onClick={() => electronAPI.minApp()}/>
      <Button type="text" icon={isMax ? <CompressOutlined/> : <ExpandOutlined/>} onClick={() => {
        electronAPI.maxApp()
        setIsMax(!isMax)
        isMax ? electronAPI.unmaxApp() : electronAPI.maxApp()
      }}/>
      <Button type="text" id="closed-btn" icon={<CloseOutlined/>} onClick={() => electronAPI.closeApp()}/>
    </div>
  </div>
}